import React from 'react';
import { View } from 'react-native';
import List from '../list/List';
import Picker from './Picker';

import  {district}  from '../dist/index';



export default class PopupPickerDemo extends React.Component<any, any> {
  constructor(props: any) {
    super(props);
    this.state = {
      data: [],
      value: [],
    };
  }
  onClick = () => {
    // console.log('start loading data');
    setTimeout(() => {
      this.setState({
        data: [{ label: "创建人", value: "创建人",},
          {
            label: "审批人",
            value: "审批人",
          }],
      });
    }, 500);
  }
  onChange = (value) => {
    // console.log(value);
    this.setState({ value });
  }
  render() {
    return (
      <View style={{ marginTop: 30 }}>
          <Picker
            data={this.state.data}
            cols={2}
            value={this.state.value}
            onChange={this.onChange}
          >
            <List.Item arrow="horizontal" last onClick={this.onClick}>
              省市选择(异步加载)
            </List.Item>
          </Picker>
      </View>
    );
  }
}
